dir0=$(pwd)

for ii in $(find * -type d ); 
do
    cd $ii; 
    pwd
    echo before ...
    echo
    ls
    echo
    echo after ...
    rm -f *.eps Frac*.root Combined*.root;
    ls
    echo

    #data=$(pwd | awk -F\/ '{print $11}')
    data=$(basename $(pwd))

    echo raw data:
    echo $data
    echo raw data done.

    echo $data
  
    ./do.sh $data 0 > seedologx0.log
    ./do.sh $data 1 > seedologx1.log

    hadd Combined_$data\_ETAALL.root Fraction*.root > seehadd.log
    cd $dir0
done

echo 
echo
echo "checking too small error!!"

grep "ystaterr 0.000000" */seedologx0.log  | sort -u

echo "done"

exit

cd cmpPeriod
echo before ...
echo
ls
echo
echo after ...
rm -f *.eps Frac*.root 
ls
echo

./do.sh > see.log
exit

root -b -l -q 'drawFractionRatio.C("period",0,"Combined_0de_ETAALL.root","Combined_10d_ETAALL.root","Combined_10e_ETAALL.root","",0,"ratio to (I)",5,1,0)'
root -b -l -q 'drawFractionRatio.C("period",1,"Combined_0de_ETAALL.root","Combined_10d_ETAALL.root","Combined_10e_ETAALL.root","",0,"ratio to (I)",5,1,0)'
root -b -l -q 'drawFractionRatio.C("period",2,"Combined_0de_ETAALL.root","Combined_10d_ETAALL.root","Combined_10e_ETAALL.root","",0,"ratio to (I)",5,1,0)'
root -b -l -q 'drawFractionRatio.C("period",3,"Combined_0de_ETAALL.root","Combined_10d_ETAALL.root","Combined_10e_ETAALL.root","",0,"ratio to (I)",5,1,1)'

root -b -l -q 'drawFractionRatio.C("period",0,"Combined_0de_ETAALL.root","Combined_10d_ETAALL.root","Combined_10e_ETAALL.root","",0,"ratio to (I)",5,0,0)'
root -b -l -q 'drawFractionRatio.C("period",1,"Combined_0de_ETAALL.root","Combined_10d_ETAALL.root","Combined_10e_ETAALL.root","",0,"ratio to (I)",5,0,0)'
root -b -l -q 'drawFractionRatio.C("period",2,"Combined_0de_ETAALL.root","Combined_10d_ETAALL.root","Combined_10e_ETAALL.root","",0,"ratio to (I)",5,0,0)'
root -b -l -q 'drawFractionRatio.C("period",3,"Combined_0de_ETAALL.root","Combined_10d_ETAALL.root","Combined_10e_ETAALL.root","",0,"ratio to (I)",5,0,1)'

root -b -l -q 'drawCompDataA.C(0,"Combined_10h_ETAALL.root","Combined_11a_ETAALL.root","Combined_0de_ETAALL.root",1)'
root -b -l -q 'drawCompDataA.C(1,"Combined_10h_ETAALL.root","Combined_11a_ETAALL.root","Combined_0de_ETAALL.root",1)'
root -b -l -q 'drawCompDataA.C(2,"Combined_10h_ETAALL.root","Combined_11a_ETAALL.root","Combined_0de_ETAALL.root",1)'
root -b -l -q 'drawCompDataA.C(3,"Combined_10h_ETAALL.root","Combined_11a_ETAALL.root","Combined_0de_ETAALL.root",1,1)'

root -b -l -q 'drawCompDataA.C(0,"Combined_10h_ETAALL.root","Combined_11a_ETAALL.root","Combined_0de_ETAALL.root",0)'
root -b -l -q 'drawCompDataA.C(1,"Combined_10h_ETAALL.root","Combined_11a_ETAALL.root","Combined_0de_ETAALL.root",0)'
root -b -l -q 'drawCompDataA.C(2,"Combined_10h_ETAALL.root","Combined_11a_ETAALL.root","Combined_0de_ETAALL.root",0)'
root -b -l -q 'drawCompDataA.C(3,"Combined_10h_ETAALL.root","Combined_11a_ETAALL.root","Combined_0de_ETAALL.root",0,1)'
